package com.itheima.service.impl;

import com.itheima.domain.Orders;
import com.itheima.mapper.OrdersMapper;
import com.itheima.service.OrdersService;
import com.itheima.utils.MapperUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class OrdersServiceImpl implements OrdersService {
    public List<Orders> findAll() {
        SqlSession session = MapperUtil.getSession();
        OrdersMapper mapper = session.getMapper(OrdersMapper.class);
        List<Orders> list = mapper.findAll();
        MapperUtil.close(session);
        return list;
    }

}
